package com.sqly.doc.menu.jkpgb;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.IdRes;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.View;
import android.view.animation.Animation;
import android.view.inputmethod.EditorInfo;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
import android.widget.TextView;

import com.alibaba.fastjson.JSON;
import com.ihidea.multilinechooselib.MultiLineChooseLayout;
import com.loopj.android.http.AsyncHttpResponseHandler;
import com.loopj.android.http.RequestParams;
import com.sqly.doc.R;
import com.sqly.doc.base.MyBaseActivity;
import com.sqly.doc.pojo.Jkpgb;
import com.sqly.doc.pojo.RetMsg;
import com.sqly.doc.util.Constants;
import com.sqly.doc.util.DateConvert;
import com.sqly.doc.util.HttpUrl;
import com.sqly.doc.util.MyToastUtil;
import com.sqly.doc.util.NetWorkUtils;
import com.sqly.doc.util.SharedPreferencesUtils;
import com.sqly.doc.util.SweetAlertDialogUtil;
import com.sqly.doc.util.UserClient;
import com.sqly.doc.view.CustomDatePicker;
import com.sqly.doc.view.StringUtils;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import butterknife.Bind;
import butterknife.ButterKnife;
import cxy.com.validate.IValidateResult;
import cxy.com.validate.Validate;
import cxy.com.validate.annotation.Index;
import cxy.com.validate.annotation.MaxLength;
import cxy.com.validate.annotation.NotNull;
import cxy.com.validate.annotation.RE;
import cz.msebera.android.httpclient.Header;

public class jkpgb_add extends MyBaseActivity {
    @Index(1)
    @NotNull(msg = "建立时间不能为空")
    @Bind(R.id.jlsj)
    TextView jlsj;

    @Index(2)
    @NotNull(msg = "体重不能为空")
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.weight)
    EditText weight;

    @Index(3)
    @NotNull(msg = "身高不能为空")
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.height)
    EditText height;

    @Index(4)
    @NotNull(msg = "体重指数不能为空")
    @Bind(R.id.bmi)
    TextView bmi;

    @Index(5)
    @NotNull(msg = "腰围不能为空")
    @RE(re = RE.only_number, msg = "舒张压仅可输入数字，请重新输入")
    @Bind(R.id.yaowei)
    EditText yaowei;

    @Index(6)
    @NotNull(msg = "收缩压不能为空")
    @RE(re = RE.only_number, msg = "收缩压仅可输入数字，请重新输入")
    @Bind(R.id.xy1)
    EditText xy1;

    @Index(7)
    @NotNull(msg = "舒张压不能为空")
    @RE(re = RE.only_number, msg = "舒张压仅可输入数字，请重新输入")
    @Bind(R.id.xy2)
    EditText xy2;

    @Bind(R.id.tz_pgjg)
    RadioGroup tz_pgjg;

    @Bind(R.id.yw_pgjg)
    RadioGroup yw_pgjg;

    @Bind(R.id.xy_pgjg)
    RadioGroup xy_pgjg;




    @Bind(R.id.tlld_lx)
    RadioGroup tlld_lx;

    @Bind(R.id.tlld_pgjg)
    RadioGroup tlld_pgjg;

    @Index(8)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.shiyan_rsrl)
    EditText shiyan_rsrl;

    @Index(9)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.tang_rsrl)
    EditText tang_rsrl;

    @Index(10)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.you_rsrl)
    EditText you_rsrl;

    @Bind(R.id.ysxg_pgjg)
    MultiLineChooseLayout ysxg_pgjg;
    private List<String> ysxgpgjgdata = new ArrayList<>();

    @Index(11)
    @RE(re = RE.only_number, msg = "仅可输入数字，请重新输入")
    @Bind(R.id.rxyl)
    EditText rxyl;

    @Index(12)
    @RE(re = RE.only_number, msg = "仅可输入数字，请重新输入")
    @Bind(R.id.ksxynl)
    EditText ksxynl;

    @Index(13)
    @RE(re = RE.only_number, msg = "仅可输入数字，请重新输入")
    @Bind(R.id.jynl)
    EditText jynl;

    @Bind(R.id.xyqk)
    RadioGroup xyqk;//血压情况

    @Bind(R.id.xyqk_pgjg)
    RadioGroup xyqk_pgjg;

    @Index(14)
    @RE(re = RE.only_number, msg = "仅可输入数字，请重新输入")
    @Bind(R.id.yj_mygdbj_ci)
    EditText yj_mygdbj_ci;

    @Index(15)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_mygdbj_ke)
    EditText yj_mygdbj_ke;

    @Index(16)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_mygdbj_cjjke)
    EditText yj_mygdbj_cjjke;

    @Index(17)
    @RE(re = RE.only_number, msg = "仅可输入数字，请重新输入")
    @Bind(R.id.yj_myddbj_ci)
    EditText yj_myddbj_ci;
    @Index(18)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_myddbj_ke)
    EditText yj_myddbj_ke;
    @Index(19)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_myddbj_cjjke)
    EditText yj_myddbj_cjjke;

    @Index(20)
    @RE(re = RE.only_number, msg = "仅可输入数字，请重新输入")
    @Bind(R.id.yj_mypj_ci)
    EditText yj_mypj_ci;
    @Index(21)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_mypj_hs)
    EditText yj_mypj_hs;
    @Index(22)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_mypj_cjjke)
    EditText yj_mypj_cjjke;

    @Index(23)
    @RE(re = RE.only_number, msg = "仅可输入数字，请重新输入")
    @Bind(R.id.yj_myptj_ci)
    EditText yj_myptj_ci;
    @Index(24)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_myptj_hs)
    EditText yj_myptj_hs;
    @Index(25)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_myptj_cjjke)
    EditText yj_myptj_cjjke;

    @Index(26)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.yj_rjyjl)
    EditText yj_rjyjl;

    @Bind(R.id.yj_pgjg)RadioGroup yj_pgjg;

    @Bind(R.id.tgjc_pf)RadioGroup tgjc_pf;

    @Index(27)
    @MaxLength(length = 20, msg = "最大长度为20个字符")
    @Bind(R.id.tgjc_pf_qt)
    EditText tgjc_pf_qt;

    @Bind(R.id.tgjc_gm)RadioGroup tgjc_gm;

    @Index(28)
    @MaxLength(length = 20, msg = "最大长度为20个字符")
    @Bind(R.id.tgjc_gm_qt)
    EditText tgjc_gm_qt;

    @Bind(R.id.tgjc_lbj)RadioGroup tgjc_lbj;

    @Index(29)
    @MaxLength(length = 20, msg = "最大长度为20个字符")
    @Bind(R.id.tgjc_lbj_qt)
    EditText tgjc_lbj_qt;

    @Bind(R.id.tgjc_fei_tzx)RadioGroup tgjc_fei_tzx;

    @Bind(R.id.tgjc_fei_hxy)RadioGroup tgjc_fei_hxy;

    @Bind(R.id.tgjc_fei_ly)RadioGroup tgjc_fei_ly;

    @Index(29)
    @MaxLength(length = 20, msg = "最大长度为20个字符")
    @Bind(R.id.tgjc_fei_ly_qt)
    EditText tgjc_fei_ly_qt;

    @Index(30)
    @RE(re = RE.only_number, msg = "仅可输入数字，请重新输入")
    @Bind(R.id.tgjc_xz_xl_ci)
    EditText tgjc_xz_xl_ci;

    @Bind(R.id.tgjc_xz_xl)RadioGroup tgjc_xz_xl;

    @Bind(R.id.tgjc_xz_zy)RadioGroup tgjc_xz_zy;

    @Bind(R.id.tgjc_fb_yt)RadioGroup tgjc_fb_yt;
    @Bind(R.id.tgjc_fb_bk)RadioGroup tgjc_fb_bk;
    @Bind(R.id.tgjc_fb_gd)RadioGroup tgjc_fb_gd;
    @Bind(R.id.tgjc_fb_pd)RadioGroup tgjc_fb_pd;
    @Bind(R.id.tgjc_fb_ydxzy)RadioGroup tgjc_fb_ydxzy;
    @Bind(R.id.tgjc_xzsz)RadioGroup tgjc_xzsz;
    @Bind(R.id.tgjc_zbdmbd)RadioGroup tgjc_zbdmbd;
    @Bind(R.id.tgjc_rx)RadioGroup tgjc_rx;

    @Index(31)
    @MaxLength(length = 20, msg = "最大长度为20个字符")
    @Bind(R.id.tgjc_rx_qt)
    EditText tgjc_rx_qt;

    @Bind(R.id.tgjc_pgjg)RadioGroup tgjc_pgjg;

    @Index(32)
    @MaxLength(length = 20, msg = "最大长度为20个字符")
    @Bind(R.id.tgjc_pgjg_ycqk)
    EditText tgjc_pgjg_ycqk;

    @Index(33)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.fzjc_xt_kfxtz)
    EditText fzjc_xt_kfxtz;

    @Index(34)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.fzjc_xt_fhlxsxtz)
    EditText fzjc_xt_fhlxsxtz;

    @Bind(R.id.fzjc_xt_pgjg)RadioGroup fzjc_xt_pgjg;

    @Index(35)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.fzjc_xz_zdgc)
    EditText fzjc_xz_zdgc;

    @Index(36)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.fzjc_xz_gysz)
    EditText fzjc_xz_gysz;

    @Index(37)
    @RE(re = Constants.ZZS_XS_REGEXP, msg = "仅可输入正整数或小数（小数点后保留2位数字），请重新输入")
    @Bind(R.id.fzjc_xz_dmdzdb)
    EditText fzjc_xz_dmdzdb;

    @Bind(R.id.fzjc_xz_pgjg)RadioGroup fzjc_xz_pgjg;

    @Bind(R.id.gwrqpg_gxygw_pgjg)RadioGroup gwrqpg_gxygw_pgjg;
    @Bind(R.id.gwrqpg_tnbgw_pgjg)RadioGroup gwrqpg_tnbgw_pgjg;
    @Bind(R.id.gwrqpg_nxgbgw_pgjg)RadioGroup gwrqpg_nxgbgw_pgjg;
    @Bind(R.id.gwrqpg_xxgbgw_pgjg)RadioGroup gwrqpg_xxgbgw_pgjg;

    @Bind(R.id.ndpgjg_jbzb)RadioGroup ndpgjg_jbzb;
    @Bind(R.id.ndpgjg_shfs)RadioGroup ndpgjg_shfs;
    @Bind(R.id.ndpgjg_tgjc)RadioGroup ndpgjg_tgjc;
    @Bind(R.id.ndpgjg_fzjc)RadioGroup ndpgjg_fzjc;




    private CustomDatePicker customDatePicker;
    Context con = jkpgb_add.this;
    //标题
    TextView title, uname;
    Jkpgb obj;
    String url = "";
    String signupid = "", signuptime="", jmxb="1";
    LinearLayout back;
    LinearLayout jbzb_ll,shfs_ll,tgjc_ll,fzjc_ll,gwrqpg_ll,pgjg_ll;
    LinearLayout jbzb_content_ll,shfs_content_ll,tgjc_content_ll,fzjc_content_ll,gwrqpg_content_ll,pgjg_content_ll;
    ImageView jbzb_image,shfs_image,tgjc_image,fzjc_image,gwrqpg_image,pgjg_image;

    @Override
    protected void initUI() {
        setContentView(R.layout.jkpgb_add);
        ButterKnife.bind(this);
        Validate.reg(this);
        signupid = getIntent().getStringExtra("signupid");
        signuptime=getIntent().getStringExtra("signuptime");
        jmxb=getIntent().getStringExtra("jmxb");
        if (getIntent().getStringExtra("type").equals("edit")) {
            obj = (Jkpgb) getIntent().getExtras().getSerializable("b");
            url = HttpUrl.EditJkpgb;
        } else {
            url = HttpUrl.AddJkpgb;
            obj = new  Jkpgb();
        }
        intTopUi();
        initJbzb();
        initShfsUi();
        initTgjcUi();
        initFzjcUi();
        initGwrqpgUi();
        initPgjgUi();

        menuClick();
    }

    private void menuClick() {
        jbzb_ll = (LinearLayout) findViewById(R.id.jbzb_ll);
        shfs_ll = (LinearLayout) findViewById(R.id.shfs_ll);
        tgjc_ll = (LinearLayout) findViewById(R.id.tgjc_ll);
        fzjc_ll = (LinearLayout) findViewById(R.id.fzjc_ll);
        gwrqpg_ll = (LinearLayout) findViewById(R.id.gwrqpg_ll);
        pgjg_ll = (LinearLayout) findViewById(R.id.pgjg_ll);

        jbzb_image = (ImageView) findViewById(R.id.jbzb_image);
        shfs_image = (ImageView) findViewById(R.id.shfs_image);
        tgjc_image = (ImageView) findViewById(R.id.tgjc_image);
        fzjc_image = (ImageView) findViewById(R.id.fzjc_image);
        gwrqpg_image = (ImageView) findViewById(R.id.gwrqpg_image);
        pgjg_image = (ImageView) findViewById(R.id.pgjg_image);

        jbzb_content_ll = (LinearLayout) findViewById(R.id.jbzb_content_ll);
        shfs_content_ll = (LinearLayout) findViewById(R.id.shfs_content_ll);
        tgjc_content_ll = (LinearLayout) findViewById(R.id.tgjc_content_ll);
        fzjc_content_ll = (LinearLayout) findViewById(R.id.fzjc_content_ll);
        gwrqpg_content_ll = (LinearLayout) findViewById(R.id.gwrqpg_content_ll);
        pgjg_content_ll = (LinearLayout) findViewById(R.id.pgjg_content_ll);

        jbzb_ll.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                shfs_image.setImageResource(R.mipmap.zsj);
                tgjc_image.setImageResource(R.mipmap.zsj);
                fzjc_image.setImageResource(R.mipmap.zsj);
                gwrqpg_image.setImageResource(R.mipmap.zsj);
                pgjg_image.setImageResource(R.mipmap.zsj);

                if (jbzb_content_ll.getVisibility() == View.VISIBLE) {
                    jbzb_image.setImageResource(R.mipmap.zsj);
                    jbzb_content_ll.setVisibility(View.GONE);
                } else {
                    jbzb_image.setImageResource(R.mipmap.xsj);
                    jbzb_content_ll.setVisibility(View.VISIBLE);
                }

                shfs_content_ll.setVisibility(View.GONE);
                tgjc_content_ll.setVisibility(View.GONE);
                fzjc_content_ll.setVisibility(View.GONE);
                gwrqpg_content_ll.setVisibility(View.GONE);
                pgjg_content_ll.setVisibility(View.GONE);
            }
        });

        shfs_ll.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                jbzb_image.setImageResource(R.mipmap.zsj);
                tgjc_image.setImageResource(R.mipmap.zsj);
                fzjc_image.setImageResource(R.mipmap.zsj);
                gwrqpg_image.setImageResource(R.mipmap.zsj);
                pgjg_image.setImageResource(R.mipmap.zsj);

                if (shfs_content_ll.getVisibility() == View.VISIBLE) {
                   shfs_image.setImageResource(R.mipmap.zsj);
                   shfs_content_ll.setVisibility(View.GONE);
                } else {
                   shfs_image.setImageResource(R.mipmap.xsj);
                   shfs_content_ll.setVisibility(View.VISIBLE);
                }

                jbzb_content_ll.setVisibility(View.GONE);
                tgjc_content_ll.setVisibility(View.GONE);
                fzjc_content_ll.setVisibility(View.GONE);
                gwrqpg_content_ll.setVisibility(View.GONE);
                pgjg_content_ll.setVisibility(View.GONE);
            }
        });

        tgjc_ll.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                jbzb_image.setImageResource(R.mipmap.zsj);
                shfs_image.setImageResource(R.mipmap.zsj);
                fzjc_image.setImageResource(R.mipmap.zsj);
                gwrqpg_image.setImageResource(R.mipmap.zsj);
                pgjg_image.setImageResource(R.mipmap.zsj);

                if (tgjc_content_ll.getVisibility() == View.VISIBLE) {
                    tgjc_image.setImageResource(R.mipmap.zsj);
                    tgjc_content_ll.setVisibility(View.GONE);
                } else {
                    tgjc_image.setImageResource(R.mipmap.xsj);
                    tgjc_content_ll.setVisibility(View.VISIBLE);
                }

                jbzb_content_ll.setVisibility(View.GONE);
                shfs_content_ll.setVisibility(View.GONE);
                fzjc_content_ll.setVisibility(View.GONE);
                gwrqpg_content_ll.setVisibility(View.GONE);
                pgjg_content_ll.setVisibility(View.GONE);
            }
        });

        fzjc_ll.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                jbzb_image.setImageResource(R.mipmap.zsj);
                shfs_image.setImageResource(R.mipmap.zsj);
                tgjc_image.setImageResource(R.mipmap.zsj);
                gwrqpg_image.setImageResource(R.mipmap.zsj);
                pgjg_image.setImageResource(R.mipmap.zsj);

                if (fzjc_content_ll.getVisibility() == View.VISIBLE) {
                    fzjc_image.setImageResource(R.mipmap.zsj);
                    fzjc_content_ll.setVisibility(View.GONE);
                } else {
                    fzjc_image.setImageResource(R.mipmap.xsj);
                    fzjc_content_ll.setVisibility(View.VISIBLE);
                }

                jbzb_content_ll.setVisibility(View.GONE);
                shfs_content_ll.setVisibility(View.GONE);
                tgjc_content_ll.setVisibility(View.GONE);
                gwrqpg_content_ll.setVisibility(View.GONE);
                pgjg_content_ll.setVisibility(View.GONE);
            }
        });

        gwrqpg_ll.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                jbzb_image.setImageResource(R.mipmap.zsj);
                shfs_image.setImageResource(R.mipmap.zsj);
                tgjc_image.setImageResource(R.mipmap.zsj);
                fzjc_image.setImageResource(R.mipmap.zsj);
                pgjg_image.setImageResource(R.mipmap.zsj);

                if (gwrqpg_content_ll.getVisibility() == View.VISIBLE) {
                    gwrqpg_image.setImageResource(R.mipmap.zsj);
                    gwrqpg_content_ll.setVisibility(View.GONE);
                } else {
                    gwrqpg_image.setImageResource(R.mipmap.xsj);
                    gwrqpg_content_ll.setVisibility(View.VISIBLE);
                }

                jbzb_content_ll.setVisibility(View.GONE);
                shfs_content_ll.setVisibility(View.GONE);
                tgjc_content_ll.setVisibility(View.GONE);
                fzjc_content_ll.setVisibility(View.GONE);
                pgjg_content_ll.setVisibility(View.GONE);
            }
        });

        pgjg_ll.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                jbzb_image.setImageResource(R.mipmap.zsj);
                shfs_image.setImageResource(R.mipmap.zsj);
                tgjc_image.setImageResource(R.mipmap.zsj);
                fzjc_image.setImageResource(R.mipmap.zsj);
                gwrqpg_image.setImageResource(R.mipmap.zsj);

                if (pgjg_content_ll.getVisibility() == View.VISIBLE) {
                    pgjg_image.setImageResource(R.mipmap.zsj);
                    pgjg_content_ll.setVisibility(View.GONE);
                } else {
                    pgjg_image.setImageResource(R.mipmap.xsj);
                    pgjg_content_ll.setVisibility(View.VISIBLE);
                }

                jbzb_content_ll.setVisibility(View.GONE);
                shfs_content_ll.setVisibility(View.GONE);
                tgjc_content_ll.setVisibility(View.GONE);
                fzjc_content_ll.setVisibility(View.GONE);
                gwrqpg_content_ll.setVisibility(View.GONE);
            }
        });
    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
    }

    public void intTopUi(){
        title = (TextView) findViewById(R.id.title);
        uname = (TextView) findViewById(R.id.uname);
        title.setText("健康评估表");
        back = (LinearLayout) findViewById(R.id.back);
        back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        uname.setText("保存");
        uname.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Validate.check(con, new IValidateResult() {
                    @Override
                    public void onValidateSuccess() {
                        //Toast.makeText(con, "验证成功", Toast.LENGTH_SHORT).show();
                        saveData();
                    }

                    @Override
                    public void onValidateError(String msg, View view) {
                        view.setFocusable(true);
                        //Toast.makeText(con, msg, Toast.LENGTH_SHORT).show();
                        SweetAlertDialogUtil.WarningDialog(con, "提示", msg);
                    }

                    @Override
                    public Animation onValidateErrorAnno() {
//                        return ValidateAnimation.horizontalTranslate();
                        return null;
                    }
                });
            }
        });
    }

    //基本指标
    public void initJbzb() {
        if (obj != null && !StringUtils.isEmpty(obj.getMake_time())) {
            jlsj.setText(DateConvert.dateToString(DateConvert.toDate(obj.getMake_time(), DateConvert.YMD), DateConvert.YMD)+"");
        }
        final String minfajlsj = DateConvert.dateToString(DateConvert.toDate(signuptime, DateConvert.YMDHM), DateConvert.YMDHM);
        jlsj.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.CHINA);
                customDatePicker = new CustomDatePicker(con, new CustomDatePicker.ResultHandler() {
                    @Override
                    public void handle(String time) { // 回调接口，获得选中的时间
                        jlsj.setText(time.split(" ")[0]);
                    }
                }, minfajlsj, DateConvert.getCustomDatePickerEndRq()); // 初始化日期格式请用：yyyy-MM-dd HH:mm，否则不能正常运行
                customDatePicker.showSpecificTime(false); // 不显示时和分
                customDatePicker.setIsLoop(false); // 不允许循环滚动
                if (obj != null && !StringUtils.isEmpty(obj.getMake_time())) {
                    customDatePicker.show(DateConvert.dateToString(DateConvert.toDate(obj.getMake_time(), DateConvert.YMD), DateConvert.YMD));
                }else {
                    customDatePicker.show(minfajlsj);
                }
            }
        });

        weight.addTextChangedListener(new BmiChangeListener());
        weight.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getWeight())) {
            weight.setText(obj.getWeight());
        }

        height.addTextChangedListener(new BmiChangeListener());
        height.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getHeight())) {
            height.setText(obj.getHeight());
        }
        yaowei.addTextChangedListener(new YaoWeiChangeListener());
        yaowei.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getYaowei())) {
            yaowei.setText(obj.getYaowei());
        }

        xy1.addTextChangedListener(new XueYaChangeListener());
        xy1.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getXy1())) {
            xy1.setText(obj.getXy1());
        }

        xy2.addTextChangedListener(new XueYaChangeListener());
        xy2.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getXy2())) {
            xy2.setText(obj.getXy2());
        }

        //体重评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getTz_pgjg())) {
            switch (Integer.parseInt(obj.getTz_pgjg())) {
                case 1:
                    tz_pgjg.check(R.id.tz_pgjg_gq);
                    break;
                case 2:
                    tz_pgjg.check(R.id.tz_pgjg_zc);
                    break;
                case 3:
                    tz_pgjg.check(R.id.tz_pgjg_cz);
                    break;
                case 4:
                    tz_pgjg.check(R.id.tz_pgjg_fp);
                    break;
            }
        } else {
            tz_pgjg.check(R.id.tz_pgjg_zc);
        }
        tz_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tz_pgjg_gq == checkedId)
                    obj.setTz_pgjg("1");
                if (R.id.tz_pgjg_zc == checkedId)
                    obj.setTz_pgjg("2");
                if (R.id.tz_pgjg_cz == checkedId)
                    obj.setTz_pgjg("3");
                if (R.id.tz_pgjg_fp == checkedId)
                    obj.setTz_pgjg("4");
            }
        });

        //腰围评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getYw_pgjg())) {
            switch (Integer.parseInt(obj.getYw_pgjg())) {
                case 1:
                    yw_pgjg.check(R.id.yw_pgjg_gd);
                    break;
                case 2:
                    yw_pgjg.check(R.id.yw_pgjg_zc);
                    break;
            }
        } else {
            yw_pgjg.check(R.id.yw_pgjg_zc);
        }
        yw_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.yw_pgjg_gd == checkedId)
                    obj.setYw_pgjg("1");
                if (R.id.tz_pgjg_zc == checkedId)
                    obj.setYw_pgjg("2");
            }
        });

        //血压评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getXy_pgjg())) {
            switch (Integer.parseInt(obj.getXy_pgjg())) {
                case 1:
                    xy_pgjg.check(R.id.xy_pgjg_zc);
                    break;
                case 2:
                    xy_pgjg.check(R.id.xy_pgjg_dxy);
                    break;
                case 3:
                    xy_pgjg.check(R.id.xy_pgjg_gxy);
                    break;
            }
        } else {
            xy_pgjg.check(R.id.xy_pgjg_zc);
        }
        xy_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.xy_pgjg_zc == checkedId)
                    obj.setXy_pgjg("1");
                if (R.id.xy_pgjg_dxy == checkedId)
                    obj.setXy_pgjg("2");
                if (R.id.xy_pgjg_gxy == checkedId)
                    obj.setXy_pgjg("3");
            }
        });
    }

    public void initShfsUi(){
        //体力劳动
        if (obj != null && !StringUtils.isEmpty(obj.getTlld_lx())) {
            switch (Integer.parseInt(obj.getTlld_lx())) {
                case 1:
                    tlld_lx.check(R.id.tlld_lx_zz);
                    break;
                case 2:
                    tlld_lx.check(R.id.tlld_lx_lz);
                    break;
                case 3:
                    tlld_lx.check(R.id.tlld_lx_shbcxld);
                    break;
                case 4:
                    tlld_lx.check(R.id.tlld_lx_bhqgdgz);
                    break;
                case 5:
                    tlld_lx.check(R.id.tlld_lx_bhqgfhgz);
                    break;
                case 6:
                    tlld_lx.check(R.id.tlld_lx_jzld);
                    break;
            }
        }
        tlld_lx.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tlld_lx_zz == checkedId) {
                    obj.setTlld_lx("1");
                    tlld_pgjg.check(R.id.tlld_pgjg_qld);
                }
                if (R.id.tlld_lx_lz == checkedId) {
                    obj.setTlld_lx("2");
                    tlld_pgjg.check(R.id.tlld_pgjg_qld);
                }
                if (R.id.tlld_lx_shbcxld == checkedId) {
                    obj.setTlld_lx("3");
                    tlld_pgjg.check(R.id.tlld_pgjg_zdld);
                }
                if (R.id.tlld_lx_bhqgdgz == checkedId) {
                    obj.setTlld_lx("4");
                    tlld_pgjg.check(R.id.tlld_pgjg_zdld);
                }
                if (R.id.tlld_lx_bhqgfhgz == checkedId) {
                    obj.setTlld_lx("5");
                    tlld_pgjg.check(R.id.tlld_pgjg_zld);
                }
                if (R.id.tlld_lx_jzld == checkedId) {
                    obj.setTlld_lx("6");
                    tlld_pgjg.check(R.id.tlld_pgjg_jzld);
                }
            }
        });

        //体力劳动评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getTlld_pgjg())) {
            switch (Integer.parseInt(obj.getTlld_pgjg())) {
                case 1:
                    tlld_pgjg.check(R.id.tlld_pgjg_qld);
                    break;
                case 2:
                    tlld_pgjg.check(R.id.tlld_pgjg_zdld);
                    break;
                case 3:
                    tlld_pgjg.check(R.id.tlld_pgjg_zld);
                    break;
                case 4:
                    tlld_pgjg.check(R.id.tlld_pgjg_jzld);
                    break;
            }
        }
        tlld_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tlld_pgjg_qld == checkedId) {
                    obj.setTlld_pgjg("1");
                }
                if (R.id.tlld_pgjg_zdld == checkedId) {
                    obj.setTlld_pgjg("2");
                }
                if (R.id.tlld_pgjg_zld == checkedId) {
                    obj.setTlld_pgjg("3");
                }
                if (R.id.tlld_pgjg_jzld == checkedId) {
                    obj.setTlld_pgjg("4");
                }
            }
        });

        shiyan_rsrl.addTextChangedListener(new YsxgPgjgChangeListener());
        shiyan_rsrl.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getShiyan_rsrl())) {
            shiyan_rsrl.setText(obj.getShiyan_rsrl());
        }
        tang_rsrl.addTextChangedListener(new YsxgPgjgChangeListener());
        tang_rsrl.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getTang_rsrl())) {
            tang_rsrl.setText(obj.getTang_rsrl());
        }
        you_rsrl.addTextChangedListener(new YsxgPgjgChangeListener());
        you_rsrl.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getYou_rsrl())) {
            you_rsrl.setText(obj.getYou_rsrl());
        }
        //飲食習慣評估結果
        ysxgpgjgdata.add("正常");
        ysxgpgjgdata.add("高盐");
        ysxgpgjgdata.add("高糖");
        ysxgpgjgdata.add("食用油摄入量偏高");
        ysxg_pgjg.setList(ysxgpgjgdata);
        if (obj != null && !StringUtils.isEmpty(obj.getYsxg_pgjg())) {//1-正常，2-高盐，3-高糖,4-食用油摄入量偏高
            if (obj.getYsxg_pgjg().contains("1"))
                ysxg_pgjg.setIndexItemSelected(0);
            if (obj.getYsxg_pgjg().contains("2"))
                ysxg_pgjg.setIndexItemSelected(1);
            if (obj.getYsxg_pgjg().contains("3"))
                ysxg_pgjg.setIndexItemSelected(2);
            if (obj.getYsxg_pgjg().contains("4"))
                ysxg_pgjg.setIndexItemSelected(3);
        }

        rxyl.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getRxyl())) {
            rxyl.setText(obj.getRxyl());
        }
        ksxynl.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getKsxynl())) {
            ksxynl.setText(obj.getKsxynl());
        }
        jynl.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getJynl())) {
            jynl.setText(obj.getJynl());
        }

        //吸煙情況
        if (obj != null && !StringUtils.isEmpty(obj.getXyqk())) {
            switch (Integer.parseInt(obj.getXyqk())) {
                case 1:
                    xyqk.check(R.id.xyqk_cbxy);
                    break;
                case 2:
                    xyqk.check(R.id.xyqk_yjy);
                    break;
                case 3:
                    xyqk.check(R.id.xyqk_xy);
                    break;
            }
        }
        xyqk.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.xyqk_cbxy == checkedId) {
                    obj.setXyqk("1");
                    obj.setXyqk_pgjg("1");
                    xyqk_pgjg.check(R.id.xyqk_pgjg_cbxy);
                }
                if (R.id.xyqk_yjy == checkedId) {
                    obj.setXyqk("2");
                    obj.setXyqk_pgjg("2");
                    xyqk_pgjg.check(R.id.xyqk_pgjg_yjy);
                }
                if (R.id.xyqk_xy == checkedId) {
                    obj.setXyqk("3");
                    obj.setXyqk_pgjg("3");
                    xyqk_pgjg.check(R.id.xyqk_pgjg_xy);
                }
            }
        });

        //吸煙评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getXyqk_pgjg())) {
            switch (Integer.parseInt(obj.getXyqk_pgjg())) {
                case 1:
                    xyqk_pgjg.check(R.id.xyqk_pgjg_cbxy);
                    break;
                case 2:
                    xyqk_pgjg.check(R.id.xyqk_pgjg_yjy);
                    break;
                case 3:
                    xyqk_pgjg.check(R.id.xyqk_pgjg_xy);
                    break;
            }
        }
        xyqk_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.xyqk_pgjg_cbxy == checkedId) {
                    obj.setXyqk_pgjg("1");
                }
                if (R.id.xyqk_pgjg_yjy == checkedId) {
                    obj.setXyqk_pgjg("2");
                }
                if (R.id.xyqk_pgjg_xy == checkedId) {
                    obj.setXyqk_pgjg("3");
                }
            }
        });
        //高度白酒
        yj_mygdbj_ci.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_mygdbj_ci())) {
            yj_mygdbj_ci.setText(obj.getYj_mygdbj_ci());
        }
        yj_mygdbj_ke.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_mygdbj_ke())) {
            yj_mygdbj_ke.setText(obj.getYj_mygdbj_ke());
        }
        yj_mygdbj_cjjke.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_mygdbj_cjjke())) {
            yj_mygdbj_cjjke.setText(obj.getYj_mygdbj_cjjke());
        }
        //低度白酒
        yj_myddbj_ci.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_myddbj_ci())) {
            yj_myddbj_ci.setText(obj.getYj_myddbj_ci());
        }
        yj_myddbj_ke.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_myddbj_ke())) {
            yj_myddbj_ke.setText(obj.getYj_myddbj_ke());
        }
        yj_myddbj_cjjke.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_myddbj_cjjke())) {
            yj_myddbj_cjjke.setText(obj.getYj_myddbj_cjjke());
        }
        //啤酒
        yj_mypj_ci.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_mypj_ci())) {
            yj_mypj_ci.setText(obj.getYj_mypj_ci());
        }
        yj_mypj_hs.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_mypj_hs())) {
            yj_mypj_hs.setText(obj.getYj_mypj_hs());
        }
        yj_mypj_cjjke.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_mypj_cjjke())) {
            yj_mypj_cjjke.setText(obj.getYj_mypj_cjjke());
        }
        //葡萄酒
        yj_myptj_ci.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_myptj_ci())) {
            yj_myptj_ci.setText(obj.getYj_myptj_ci());
        }
        yj_myptj_hs.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_myptj_hs())) {
            yj_myptj_hs.setText(obj.getYj_myptj_hs());
        }
        yj_myptj_cjjke.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_myptj_cjjke())) {
            yj_myptj_cjjke.setText(obj.getYj_myptj_cjjke());
        }

        yj_rjyjl.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getYj_rjyjl())) {
            yj_rjyjl.setText(obj.getYj_rjyjl());
        }

        //饮酒评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getYj_pgjg())) {
            switch (Integer.parseInt(obj.getYj_pgjg())) {
                case 1:
                    yj_pgjg.check(R.id.yj_pgjg_zcyj);
                    break;
                case 2:
                    yj_pgjg.check(R.id.yj_pgjg_wxyj);
                    break;
                case 3:
                    yj_pgjg.check(R.id.yj_pgjg_yhyj);
                    break;
            }
        }
        yj_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.yj_pgjg_zcyj == checkedId) {
                    obj.setYj_pgjg("1");
                }
                if (R.id.yj_pgjg_wxyj == checkedId) {
                    obj.setYj_pgjg("2");
                }
                if (R.id.yj_pgjg_yhyj == checkedId) {
                    obj.setYj_pgjg("3");
                }
            }
        });
    }

    public void initTgjcUi(){
        //皮肤
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_pf())) {
            switch (Integer.parseInt(obj.getTgjc_pf())) {
                case 1:
                    tgjc_pf.check(R.id.tgjc_pf_zc);
                    break;
                case 2:
                    tgjc_pf.check(R.id.tgjc_pf_ch);
                    break;
                case 3:
                    tgjc_pf.check(R.id.tgjc_pf_cb);
                    break;
                case 4:
                    tgjc_pf.check(R.id.tgjc_pf_fg);
                    break;
                case 5:
                    tgjc_pf.check(R.id.tgjc_pf_hr);
                    break;
                case 6:
                    tgjc_pf.check(R.id.tgjc_pf_sscz);
                    break;
                case 7:
                    tgjc_pf.check(R.id.tgjc_pf_qita);
                    break;
            }
        }
        tgjc_pf.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_pf_zc == checkedId) {
                    obj.setTgjc_pf("1");
                }
                if (R.id.tgjc_pf_ch == checkedId) {
                    obj.setTgjc_pf("2");
                }
                if (R.id.tgjc_pf_cb == checkedId) {
                    obj.setTgjc_pf("3");
                }
                if (R.id.tgjc_pf_fg == checkedId) {
                    obj.setTgjc_pf("4");
                }
                if (R.id.tgjc_pf_hr == checkedId) {
                    obj.setTgjc_pf("5");
                }
                if (R.id.tgjc_pf_sscz == checkedId) {
                    obj.setTgjc_pf("6");
                }
                if (R.id.tgjc_pf_qita == checkedId) {
                    obj.setTgjc_pf("7");
                }

            }
        });
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_pf_qt())) {
            tgjc_pf_qt.setText(obj.getTgjc_pf_qt());
        }

        //巩膜
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_gm())) {
            switch (Integer.parseInt(obj.getTgjc_gm())) {
                case 1:
                    tgjc_gm.check(R.id.tgjc_gm_zc);
                    break;
                case 2:
                    tgjc_gm.check(R.id.tgjc_gm_hr);
                    break;
                case 3:
                    tgjc_gm.check(R.id.tgjc_gm_cx);
                    break;
                case 4:
                    tgjc_gm.check(R.id.tgjc_gm_qita);
                    break;
            }
        }
        tgjc_gm.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_gm_zc == checkedId) {
                    obj.setTgjc_gm("1");
                }
                if (R.id.tgjc_gm_hr == checkedId) {
                    obj.setTgjc_gm("2");
                }
                if (R.id.tgjc_gm_cx == checkedId) {
                    obj.setTgjc_gm("3");
                }
                if (R.id.tgjc_gm_qita == checkedId) {
                    obj.setTgjc_gm("4");
                }
            }
        });
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_gm_qt())) {
            tgjc_gm_qt.setText(obj.getTgjc_gm_qt());
        }

        //淋巴结
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_lbj())) {
            switch (Integer.parseInt(obj.getTgjc_lbj())) {
                case 1:
                    tgjc_lbj.check(R.id.tgjc_lbj_wcj);
                    break;
                case 2:
                    tgjc_lbj.check(R.id.tgjc_lbj_sgs);
                    break;
                case 3:
                    tgjc_lbj.check(R.id.tgjc_lbj_yw);
                    break;
                case 4:
                    tgjc_lbj.check(R.id.tgjc_lbj_qita);
                    break;
            }
        }
        tgjc_lbj.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_lbj_wcj == checkedId) {
                    obj.setTgjc_lbj("1");
                }
                if (R.id.tgjc_lbj_sgs == checkedId) {
                    obj.setTgjc_lbj("2");
                }
                if (R.id.tgjc_lbj_yw == checkedId) {
                    obj.setTgjc_lbj("3");
                }
                if (R.id.tgjc_lbj_qita == checkedId) {
                    obj.setTgjc_lbj("4");
                }
            }
        });
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_lbj_qt())) {
            tgjc_lbj_qt.setText(obj.getTgjc_lbj_qt());
        }

        //桶状胸
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fei_tzx())) {
            switch (Integer.parseInt(obj.getTgjc_fei_tzx())) {
                case 1:
                    tgjc_fei_tzx.check(R.id.tgjc_fei_tzx_fou);
                    break;
                case 2:
                    tgjc_fei_tzx.check(R.id.tgjc_fei_tzx_shi);
                    break;
            }
        }
        tgjc_fei_tzx.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_fei_tzx_fou == checkedId) {
                    obj.setTgjc_fei_tzx("1");
                }
                if (R.id.tgjc_fei_tzx_shi == checkedId) {
                    obj.setTgjc_fei_tzx("2");
                }
            }
        });
        //呼吸音
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fei_hxy())) {
            switch (Integer.parseInt(obj.getTgjc_fei_hxy())) {
                case 1:
                    tgjc_fei_hxy.check(R.id.tgjc_fei_hxy_zc);
                    break;
                case 2:
                    tgjc_fei_hxy.check(R.id.tgjc_fei_hxy_yc);
                    break;
            }
        }
        tgjc_fei_hxy.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_fei_hxy_zc == checkedId) {
                    obj.setTgjc_fei_hxy("1");
                }
                if (R.id.tgjc_fei_hxy_yc == checkedId) {
                    obj.setTgjc_fei_hxy("2");
                }
            }
        });
        //罗音
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fei_ly())) {
            switch (Integer.parseInt(obj.getTgjc_fei_ly())) {
                case 1:
                    tgjc_fei_ly.check(R.id.tgjc_fei_ly_wu);
                    break;
                case 2:
                    tgjc_fei_ly.check(R.id.tgjc_fei_ly_gly);
                    break;
                case 3:
                    tgjc_fei_ly.check(R.id.tgjc_fei_ly_sly);
                    break;
                case 4:
                    tgjc_fei_ly.check(R.id.tgjc_fei_ly_qita);
                    break;
            }
        }
        tgjc_fei_ly.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_fei_ly_wu == checkedId) {
                    obj.setTgjc_fei_ly("1");
                }
                if (R.id.tgjc_fei_ly_gly == checkedId) {
                    obj.setTgjc_fei_ly("2");
                }
                if (R.id.tgjc_fei_ly_sly == checkedId) {
                    obj.setTgjc_fei_ly("3");
                }
                if (R.id.tgjc_fei_ly_qita == checkedId) {
                    obj.setTgjc_fei_ly("4");
                }
            }
        });
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fei_ly_qt())) {
            tgjc_fei_ly_qt.setText(obj.getTgjc_fei_ly_qt());
        }
        //心率-次数
        tgjc_xz_xl_ci.setInputType(EditorInfo.TYPE_CLASS_NUMBER);
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_xz_xl_ci())) {
            tgjc_xz_xl_ci.setText(obj.getTgjc_xz_xl_ci());
        }
        //杂音
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_xz_zy())) {
            switch (Integer.parseInt(obj.getTgjc_xz_zy())) {
                case 1:
                    tgjc_xz_zy.check(R.id.tgjc_xz_zy_wu);
                    break;
                case 2:
                    tgjc_xz_zy.check(R.id.tgjc_xz_zy_you);
                    break;
            }
        }
        tgjc_xz_zy.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_xz_zy_wu == checkedId) {
                    obj.setTgjc_xz_zy("1");
                }
                if (R.id.tgjc_xz_zy_you == checkedId) {
                    obj.setTgjc_xz_zy("2");
                }
            }
        });
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_xz_xl())) {
            switch (Integer.parseInt(obj.getTgjc_xz_xl())) {
                case 1:
                    tgjc_xz_xl.check(R.id.tgjc_xz_xl_qi);
                    break;
                case 2:
                    tgjc_xz_xl.check(R.id.tgjc_xz_xl_bq);
                    break;
                case 3:
                    tgjc_xz_xl.check(R.id.tgjc_xz_xl_jdbq);
                    break;
            }
        }
        tgjc_xz_xl.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_xz_xl_qi == checkedId) {
                    obj.setTgjc_xz_xl("1");
                }
                if (R.id.tgjc_xz_xl_bq == checkedId) {
                    obj.setTgjc_xz_xl("2");
                }
                if (R.id.tgjc_xz_xl_jdbq == checkedId) {
                    obj.setTgjc_xz_xl("3");
                }
            }
        });
        //腹部-压痛
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fb_yt())) {
            switch (Integer.parseInt(obj.getTgjc_fb_yt())) {
                case 1:
                    tgjc_fb_yt.check(R.id.tgjc_fb_yt_wu);
                    break;
                case 2:
                    tgjc_fb_yt.check(R.id.tgjc_fb_yt_you);
                    break;
            }
        }
        tgjc_fb_yt.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_fb_yt_wu == checkedId) {
                    obj.setTgjc_fb_yt("1");
                }
                if (R.id.tgjc_fb_yt_you == checkedId) {
                    obj.setTgjc_fb_yt("2");
                }
            }
        });

        //腹部-包块
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fb_bk())) {
            switch (Integer.parseInt(obj.getTgjc_fb_bk())) {
                case 1:
                    tgjc_fb_bk.check(R.id.tgjc_fb_bk_wu);
                    break;
                case 2:
                    tgjc_fb_bk.check(R.id.tgjc_fb_bk_you);
                    break;
            }
        }
        tgjc_fb_bk.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_fb_bk_wu == checkedId) {
                    obj.setTgjc_fb_bk("1");
                }
                if (R.id.tgjc_fb_bk_you == checkedId) {
                    obj.setTgjc_fb_bk("2");
                }
            }
        });
        //腹部-肝大
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fb_gd())) {
            switch (Integer.parseInt(obj.getTgjc_fb_gd())) {
                case 1:
                    tgjc_fb_gd.check(R.id.tgjc_fb_gd_wu);
                    break;
                case 2:
                    tgjc_fb_gd.check(R.id.tgjc_fb_gd_you);
                    break;
            }
        }
        tgjc_fb_gd.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_fb_gd_wu == checkedId) {
                    obj.setTgjc_fb_gd("1");
                }
                if (R.id.tgjc_fb_gd_you == checkedId) {
                    obj.setTgjc_fb_gd("2");
                }
            }
        });
        //腹部-脾大
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fb_pd())) {
            switch (Integer.parseInt(obj.getTgjc_fb_pd())) {
                case 1:
                    tgjc_fb_pd.check(R.id.tgjc_fb_pd_wu);
                    break;
                case 2:
                    tgjc_fb_pd.check(R.id.tgjc_fb_pd_you);
                    break;
            }
        }
        tgjc_fb_pd.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_fb_pd_wu == checkedId) {
                    obj.setTgjc_fb_pd("1");
                }
                if (R.id.tgjc_fb_pd_you == checkedId) {
                    obj.setTgjc_fb_pd("2");
                }
            }
        });
        //腹部-移动性浊音
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_fb_ydxzy())) {
            switch (Integer.parseInt(obj.getTgjc_fb_ydxzy())) {
                case 1:
                    tgjc_fb_ydxzy.check(R.id.tgjc_fb_ydxzy_wu);
                    break;
                case 2:
                    tgjc_fb_ydxzy.check(R.id.tgjc_fb_ydxzy_you);
                    break;
            }
        }
        tgjc_fb_ydxzy.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_fb_ydxzy_wu == checkedId) {
                    obj.setTgjc_fb_ydxzy("1");
                }
                if (R.id.tgjc_fb_ydxzy_you == checkedId) {
                    obj.setTgjc_fb_ydxzy("2");
                }
            }
        });

        //下肢水肿
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_xzsz())) {
            switch (Integer.parseInt(obj.getTgjc_xzsz())) {
                case 1:
                    tgjc_xzsz.check(R.id.tgjc_xzsz_wu);
                    break;
                case 2:
                    tgjc_xzsz.check(R.id.tgjc_xzsz_dc);
                    break;
                case 3:
                    tgjc_xzsz.check(R.id.tgjc_xzsz_scbdc);
                    break;
                case 4:
                    tgjc_xzsz.check(R.id.tgjc_xzsz_scdc);
                    break;
            }
        }
        tgjc_xzsz.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_xzsz_wu == checkedId) {
                    obj.setTgjc_xzsz("1");
                }
                if (R.id.tgjc_xzsz_dc == checkedId) {
                    obj.setTgjc_xzsz("2");
                }
                if (R.id.tgjc_xzsz_scbdc == checkedId) {
                    obj.setTgjc_xzsz("3");
                }
                if (R.id.tgjc_xzsz_scdc == checkedId) {
                    obj.setTgjc_xzsz("4");
                }
            }
        });
        //足背动脉搏动
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_zbdmbd())) {
            switch (Integer.parseInt(obj.getTgjc_zbdmbd())) {
                case 1:
                    tgjc_zbdmbd.check(R.id.tgjc_zbdmbd_wcj);
                    break;
                case 2:
                    tgjc_zbdmbd.check(R.id.tgjc_zbdmbd_cjscdc);
                    break;
                case 3:
                    tgjc_zbdmbd.check(R.id.tgjc_zbdmbd_cjzcr);
                    break;
                case 4:
                    tgjc_zbdmbd.check(R.id.tgjc_zbdmbd_cjycr);
                    break;
            }
        }
        tgjc_zbdmbd.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_zbdmbd_wcj == checkedId) {
                    obj.setTgjc_zbdmbd("1");
                }
                if (R.id.tgjc_zbdmbd_cjscdc == checkedId) {
                    obj.setTgjc_zbdmbd("2");
                }
                if (R.id.tgjc_zbdmbd_cjzcr == checkedId) {
                    obj.setTgjc_zbdmbd("3");
                }
                if (R.id.tgjc_zbdmbd_cjycr == checkedId) {
                    obj.setTgjc_zbdmbd("4");
                }
            }
        });
        //乳腺
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_rx())) {
            switch (Integer.parseInt(obj.getTgjc_rx())) {
                case 1:
                    tgjc_rx.check(R.id.tgjc_rx_wjyc);
                    break;
                case 2:
                    tgjc_rx.check(R.id.tgjc_rx_rfqc);
                    break;
                case 3:
                    tgjc_rx.check(R.id.tgjc_rx_ycmr);
                    break;
                case 4:
                    tgjc_rx.check(R.id.tgjc_rx_rxbk);
                    break;
                case 5:
                    tgjc_rx.check(R.id.tgjc_rx_qita);
                    break;
            }
        }
        tgjc_rx.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_rx_wjyc == checkedId) {
                    obj.setTgjc_rx("1");
                }
                if (R.id.tgjc_rx_rfqc == checkedId) {
                    obj.setTgjc_rx("2");
                }
                if (R.id.tgjc_rx_ycmr == checkedId) {
                    obj.setTgjc_rx("3");
                }
                if (R.id.tgjc_rx_rxbk == checkedId) {
                    obj.setTgjc_rx("4");
                }
                if (R.id.tgjc_rx_qita == checkedId) {
                    obj.setTgjc_rx("5");
                }
            }
        });

        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_rx_qt())) {
            tgjc_rx_qt.setText(obj.getTgjc_rx_qt());
        }

        //体格-评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_pgjg())) {
            switch (Integer.parseInt(obj.getTgjc_pgjg())) {
                case 1:
                    tgjc_pgjg.check(R.id.tgjc_pgjg_zc);
                    break;
                case 2:
                    tgjc_pgjg.check(R.id.tgjc_pgjg_yc);
                    break;
            }
        }
        tgjc_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.tgjc_pgjg_zc == checkedId) {
                    obj.setTgjc_pgjg("1");
                }
                if (R.id.tgjc_pgjg_yc == checkedId) {
                    obj.setTgjc_pgjg("2");
                }
            }
        });

        if (obj != null && !StringUtils.isEmpty(obj.getTgjc_pgjg_ycqk())) {
            tgjc_pgjg_ycqk.setText(obj.getTgjc_pgjg_ycqk());
        }

    }

    public void initFzjcUi(){
        fzjc_xt_kfxtz.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getFzjc_xt_kfxtz())) {
            fzjc_xt_kfxtz.setText(obj.getFzjc_xt_kfxtz());
        }
        fzjc_xt_fhlxsxtz.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getFzjc_xt_fhlxsxtz())) {
            fzjc_xt_fhlxsxtz.setText(obj.getFzjc_xt_fhlxsxtz());
        }

        //血糖评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getFzjc_xt_pgjg())) {
            switch (Integer.parseInt(obj.getFzjc_xt_pgjg())) {
                case 1:
                    fzjc_xt_pgjg.check(R.id.fzjc_xt_pgjg_xtzc);
                    break;
                case 2:
                    fzjc_xt_pgjg.check(R.id.fzjc_xt_pgjg_kfxtss);
                    break;
                case 3:
                    fzjc_xt_pgjg.check(R.id.fzjc_xt_pgjg_tnb);
                    break;
            }
        }
        fzjc_xt_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.fzjc_xt_pgjg_xtzc == checkedId) {
                    obj.setFzjc_xt_pgjg("1");
                }
                if (R.id.fzjc_xt_pgjg_kfxtss == checkedId) {
                    obj.setFzjc_xt_pgjg("2");
                }
                if (R.id.fzjc_xt_pgjg_tnb == checkedId) {
                    obj.setFzjc_xt_pgjg("3");
                }
            }
        });
        fzjc_xz_zdgc.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getFzjc_xz_zdgc())) {
            fzjc_xz_zdgc.setText(obj.getFzjc_xz_zdgc());
        }
        fzjc_xz_gysz.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getFzjc_xz_gysz())) {
            fzjc_xz_gysz.setText(obj.getFzjc_xz_gysz());
        }
        fzjc_xz_dmdzdb.setInputType(8194);
        if (obj != null && !StringUtils.isEmpty(obj.getFzjc_xz_dmdzdb())) {
            fzjc_xz_dmdzdb.setText(obj.getFzjc_xz_dmdzdb());
        }
        //血糖评估结果
        if (obj != null && !StringUtils.isEmpty(obj.getFzjc_xz_pgjg())) {
            switch (Integer.parseInt(obj.getFzjc_xz_pgjg())) {
                case 1:
                    fzjc_xz_pgjg.check(R.id.fzjc_xz_pgjg_xzzc);
                    break;
                case 2:
                    fzjc_xz_pgjg.check(R.id.fzjc_xz_pgjg_gxzz);
                    break;
            }
        }
        fzjc_xz_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.fzjc_xz_pgjg_xzzc == checkedId) {
                    obj.setFzjc_xz_pgjg("1");
                }
                if (R.id.fzjc_xz_pgjg_gxzz == checkedId) {
                    obj.setFzjc_xz_pgjg("2");
                }
            }
        });

    }

    public void initGwrqpgUi(){
        //高血压高危
        if (obj != null && !StringUtils.isEmpty(obj.getGwrqpg_gxygw_pgjg())) {
            switch (Integer.parseInt(obj.getGwrqpg_gxygw_pgjg())) {
                case 0:
                    gwrqpg_gxygw_pgjg.check(R.id.gwrqpg_gxygw_pgjg_bsy);
                    break;
                case 1:
                    gwrqpg_gxygw_pgjg.check(R.id.gwrqpg_gxygw_pgjg_sy);
                    break;
            }
        }
        gwrqpg_gxygw_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.gwrqpg_gxygw_pgjg_bsy== checkedId) {
                    obj.setGwrqpg_gxygw_pgjg("0");
                }
                if (R.id.gwrqpg_gxygw_pgjg_sy == checkedId) {
                    obj.setGwrqpg_gxygw_pgjg("1");
                }
            }
        });
        //2型糖尿病高危
        if (obj != null && !StringUtils.isEmpty(obj.getGwrqpg_tnbgw_pgjg())) {
            switch (Integer.parseInt(obj.getGwrqpg_tnbgw_pgjg())) {
                case 0:
                    gwrqpg_tnbgw_pgjg.check(R.id.gwrqpg_tnbgw_pgjg_bsy);
                    break;
                case 1:
                    gwrqpg_tnbgw_pgjg.check(R.id.gwrqpg_tnbgw_pgjg_sy);
                    break;
            }
        }
        gwrqpg_tnbgw_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.gwrqpg_tnbgw_pgjg_bsy== checkedId) {
                    obj.setGwrqpg_tnbgw_pgjg("0");
                }
                if (R.id.gwrqpg_tnbgw_pgjg_sy == checkedId) {
                    obj.setGwrqpg_tnbgw_pgjg("1");
                }
            }
        });
        //脑血管疾病高危
        if (obj != null && !StringUtils.isEmpty(obj.getGwrqpg_nxgbgw_pgjg())) {
            switch (Integer.parseInt(obj.getGwrqpg_nxgbgw_pgjg())) {
                case 0:
                    gwrqpg_nxgbgw_pgjg.check(R.id.gwrqpg_nxgbgw_pgjg_bsy);
                    break;
                case 1:
                    gwrqpg_nxgbgw_pgjg.check(R.id.gwrqpg_nxgbgw_pgjg_sy);
                    break;
            }
        }
        gwrqpg_nxgbgw_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.gwrqpg_nxgbgw_pgjg_bsy== checkedId) {
                    obj.setGwrqpg_nxgbgw_pgjg("0");
                }
                if (R.id.gwrqpg_nxgbgw_pgjg_sy == checkedId) {
                    obj.setGwrqpg_nxgbgw_pgjg("1");
                }
            }
        });
        //心血管疾病高危
        if (obj != null && !StringUtils.isEmpty(obj.getGwrqpg_xxgbgw_pgjg())) {
            switch (Integer.parseInt(obj.getGwrqpg_xxgbgw_pgjg())) {
                case 0:
                    gwrqpg_xxgbgw_pgjg.check(R.id.gwrqpg_xxgbgw_pgjg_bsy);
                    break;
                case 1:
                    gwrqpg_xxgbgw_pgjg.check(R.id.gwrqpg_xxgbgw_pgjg_sy);
                    break;
            }
        }
        gwrqpg_xxgbgw_pgjg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.gwrqpg_xxgbgw_pgjg_bsy== checkedId) {
                    obj.setGwrqpg_xxgbgw_pgjg("0");
                }
                if (R.id.gwrqpg_xxgbgw_pgjg_sy == checkedId) {
                    obj.setGwrqpg_xxgbgw_pgjg("1");
                }
            }
        });
    }

    public void initPgjgUi(){
        //基本指标
        if (obj != null && !StringUtils.isEmpty(obj.getNdpgjg_jbzb())) {
            switch (Integer.parseInt(obj.getNdpgjg_jbzb())) {
                case 0:
                    ndpgjg_jbzb.check(R.id.ndpgjg_jbzb_zc);
                    break;
                case 1:
                    ndpgjg_jbzb.check(R.id.ndpgjg_jbzb_yc);
                    break;
            }
        }
        ndpgjg_jbzb.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.ndpgjg_jbzb_zc== checkedId) {
                    obj.setNdpgjg_jbzb("0");
                }
                if (R.id.ndpgjg_jbzb_yc == checkedId) {
                    obj.setNdpgjg_jbzb("1");
                }
            }
        });
        //生活方式
        if (obj != null && !StringUtils.isEmpty(obj.getNdpgjg_shfs())) {
            switch (Integer.parseInt(obj.getNdpgjg_shfs())) {
                case 0:
                    ndpgjg_shfs.check(R.id.ndpgjg_shfs_zc);
                    break;
                case 1:
                    ndpgjg_shfs.check(R.id.ndpgjg_shfs_yc);
                    break;
            }
        }
        ndpgjg_shfs.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.ndpgjg_shfs_zc== checkedId) {
                    obj.setNdpgjg_shfs("0");
                }
                if (R.id.ndpgjg_shfs_yc == checkedId) {
                    obj.setNdpgjg_shfs("1");
                }
            }
        });
        //体格检查
        if (obj != null && !StringUtils.isEmpty(obj.getNdpgjg_tgjc())) {
            switch (Integer.parseInt(obj.getNdpgjg_tgjc())) {
                case 0:
                    ndpgjg_tgjc.check(R.id.ndpgjg_tgjc_zc);
                    break;
                case 1:
                    ndpgjg_tgjc.check(R.id.ndpgjg_tgjc_yc);
                    break;
            }
        }
        ndpgjg_tgjc.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.ndpgjg_tgjc_zc== checkedId) {
                    obj.setNdpgjg_tgjc("0");
                }
                if (R.id.ndpgjg_tgjc_yc == checkedId) {
                    obj.setNdpgjg_tgjc("1");
                }
            }
        });
        //辅助检查
        if (obj != null && !StringUtils.isEmpty(obj.getNdpgjg_fzjc())) {
            switch (Integer.parseInt(obj.getNdpgjg_fzjc())) {
                case 0:
                    ndpgjg_fzjc.check(R.id.ndpgjg_fzjc_zc);
                    break;
                case 1:
                    ndpgjg_fzjc.check(R.id.ndpgjg_fzjc_yc);
                    break;
            }
        }
        ndpgjg_fzjc.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, @IdRes int checkedId) {
                if (R.id.ndpgjg_fzjc_zc== checkedId) {
                    obj.setNdpgjg_fzjc("0");
                }
                if (R.id.ndpgjg_fzjc_yc == checkedId) {
                    obj.setNdpgjg_fzjc("1");
                }
            }
        });
    }

    @Override
    protected void initData() {

    }
    @Override
    protected void initListener() {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        Validate.unreg(this);
    }

    private void saveData(){
        //保存
        if (obj == null)
            obj = new  Jkpgb();

        ArrayList<Integer> ysxgpgjglist = ysxg_pgjg.getAllItemSelectedIndex();
        String ysxgpgjgs = "";
        for (int i = 0; i < ysxgpgjglist.size(); i++) {
            if (i == 0)
                ysxgpgjgs = (ysxgpgjglist.get(i) + 1) + "";
            else
                ysxgpgjgs = ysxgpgjgs + "," + (ysxgpgjglist.get(i) + 1);
        }
        obj.setYsxg_pgjg(ysxgpgjgs);

        obj.setMake_time(jlsj.getText().toString());
        if (NetWorkUtils.isNetworkConnected(con)) {
            RequestParams ps = new RequestParams();
            ps.add("entity.sign_up_id", signupid);
            ps.add("entity.make_time", obj.getMake_time());
            ps.add("entity.weight", weight.getText().toString());
            ps.add("entity.height", height.getText().toString());
            ps.add("entity.bmi", bmi.getText().toString());
            ps.add("entity.tz_pgjg", obj.getTz_pgjg());
            ps.add("entity.yaowei", yaowei.getText().toString());
            ps.add("entity.yw_pgjg", obj.getYw_pgjg());
            ps.add("entity.xy1", xy1.getText().toString());
            ps.add("entity.xy2", xy2.getText().toString());

            ps.add("entity.tlld_lx", obj.getTlld_lx());
            ps.add("entity.tlld_pgjg", obj.getTlld_pgjg());
            ps.add("entity.shiyan_rsrl", shiyan_rsrl.getText().toString());
            ps.add("entity.tang_rsrl", tang_rsrl.getText().toString());
            ps.add("entity.you_rsrl", you_rsrl.getText().toString());
            ps.add("entity.ysxg_pgjg", obj.getYsxg_pgjg());
            ps.add("entity.rxyl", rxyl.getText().toString());
            ps.add("entity.ksxynl", ksxynl.getText().toString());
            ps.add("entity.jynl", jynl.getText().toString());
            ps.add("entity.xyqk", obj.getXyqk());
            ps.add("entity.xyqk_pgjg", obj.getXyqk_pgjg());
            ps.add("entity.yj_mygdbj_ci", yj_mygdbj_ci.getText().toString());
            ps.add("entity.yj_mygdbj_ke", yj_mygdbj_ke.getText().toString());
            ps.add("entity.yj_mygdbj_cjjke", yj_mygdbj_cjjke.getText().toString());

            ps.add("entity.yj_myddbj_ci", yj_myddbj_ci.getText().toString());
            ps.add("entity.yj_myddbj_ke", yj_myddbj_ke.getText().toString());
            ps.add("entity.yj_myddbj_cjjke", yj_myddbj_cjjke.getText().toString());

            ps.add("entity.yj_mypj_ci", yj_mypj_ci.getText().toString());
            ps.add("entity.yj_mypj_hs", yj_mypj_hs.getText().toString());
            ps.add("entity.yj_mypj_cjjke", yj_mypj_cjjke.getText().toString());

            ps.add("entity.yj_myptj_ci", yj_myptj_ci.getText().toString());
            ps.add("entity.yj_myptj_hs", yj_myptj_hs.getText().toString());
            ps.add("entity.yj_myptj_cjjke", yj_myptj_cjjke.getText().toString());

            ps.add("entity.yj_rjyjl", yj_rjyjl.getText().toString());
            ps.add("entity.yj_pgjg", obj.getYj_pgjg());

            //体格检查部分
            ps.add("entity.tgjc_pf", obj.getTgjc_pf());
            ps.add("entity.tgjc_pf_qt", tgjc_pf_qt.getText().toString());
            ps.add("entity.tgjc_gm", obj.getTgjc_gm());
            ps.add("entity.tgjc_gm_qt", tgjc_gm_qt.getText().toString());
            ps.add("entity.tgjc_lbj", obj.getTgjc_lbj());
            ps.add("entity.tgjc_lbj_qt", tgjc_lbj_qt.getText().toString());
            ps.add("entity.tgjc_fei_tzx", obj.getTgjc_fei_tzx());
            ps.add("entity.tgjc_fei_hxy", obj.getTgjc_fei_hxy());
            ps.add("entity.tgjc_fei_ly", obj.getTgjc_fei_ly());
            ps.add("entity.tgjc_fei_ly_qt", tgjc_fei_ly_qt.getText().toString());
            ps.add("entity.tgjc_xz_xl_ci", tgjc_xz_xl_ci.getText().toString());
            ps.add("entity.tgjc_xz_zy", obj.getTgjc_xz_zy());
            ps.add("entity.tgjc_xz_xl", obj.getTgjc_xz_xl());
            ps.add("entity.tgjc_fb_yt", obj.getTgjc_fb_yt());
            ps.add("entity.tgjc_fb_bk", obj.getTgjc_fb_bk());
            ps.add("entity.tgjc_fb_gd", obj.getTgjc_fb_gd());
            ps.add("entity.tgjc_fb_pd", obj.getTgjc_fb_pd());
            ps.add("entity.tgjc_fb_ydxzy", obj.getTgjc_fb_ydxzy());
            ps.add("entity.tgjc_xzsz", obj.getTgjc_xzsz());
            ps.add("entity.tgjc_zbdmbd", obj.getTgjc_zbdmbd());
            ps.add("entity.tgjc_rx", obj.getTgjc_rx());
            ps.add("entity.tgjc_rx_qt", tgjc_rx_qt.getText().toString());
            ps.add("entity.tgjc_pgjg", obj.getTgjc_pgjg());
            ps.add("entity.tgjc_pgjg_ycqk", tgjc_pgjg_ycqk.getText().toString());
            //辅助检查
            ps.add("entity.fzjc_xt_kfxtz", fzjc_xt_kfxtz.getText().toString());
            ps.add("entity.fzjc_xt_fhlxsxtz", fzjc_xt_fhlxsxtz.getText().toString());
            ps.add("entity.fzjc_xt_pgjg", obj.getFzjc_xt_pgjg());
            ps.add("entity.fzjc_xz_zdgc", fzjc_xz_zdgc.getText().toString());
            ps.add("entity.fzjc_xz_gysz", fzjc_xz_gysz.getText().toString());
            ps.add("entity.fzjc_xz_dmdzdb", fzjc_xz_dmdzdb.getText().toString());
            ps.add("entity.fzjc_xz_pgjg", obj.getFzjc_xz_pgjg());
            //高危人群评估
            ps.add("entity.gwrqpg_gxygw_pgjg", obj.getGwrqpg_gxygw_pgjg());
            ps.add("entity.gwrqpg_tnbgw_pgjg", obj.getGwrqpg_tnbgw_pgjg());
            ps.add("entity.gwrqpg_nxgbgw_pgjg", obj.getGwrqpg_nxgbgw_pgjg());
            ps.add("entity.gwrqpg_xxgbgw_pgjg", obj.getGwrqpg_xxgbgw_pgjg());
            //高危人群评估
            ps.add("entity.ndpgjg_jbzb", obj.getNdpgjg_jbzb());
            ps.add("entity.ndpgjg_shfs", obj.getNdpgjg_shfs());
            ps.add("entity.ndpgjg_tgjc", obj.getNdpgjg_tgjc());
            ps.add("entity.ndpgjg_fzjc", obj.getNdpgjg_fzjc());


            if (getIntent().getStringExtra("type").equals("edit")) {
                ps.add("entity.id", obj.getSpid());
            }
            ps.add("token", SharedPreferencesUtils.getParam(con, "token", "").toString());
            ps.add("type", "2");
            UserClient.get(url, ps, new AsyncHttpResponseHandler() {
                @Override
                public void onSuccess(int statusCode, Header[] headers, byte[] response) {
                    String content = new String(response);
                    RetMsg ret = JSON.parseObject(content, RetMsg.class);
                    if (ret.getCode().equals("200")) {
                        MyToastUtil.ShowToast(con, "成功");
                    }else{
                        MyToastUtil.ShowToast(con, ret.getInfo());
                    }
                    finish();
                }

                @Override
                public void onFailure(int statusCode, Header[] headers, byte[] errorResponse, Throwable e) {

                    MyToastUtil.ShowToast(con, "失败");
                }
            });
        }
    }


    public class BmiChangeListener implements TextWatcher {
        /**
         * 编辑框的内容发生改变之前的回调方法
         */
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }
        /**
         * 编辑框的内容正在发生改变时的回调方法 >>用户正在输入
         * 我们可以在这里实时地 通过搜索匹配用户的输入
         */
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {

        }
        /**
         * 编辑框的内容改变以后,用户没有继续输入时 的回调方法
         */
        @Override
        public void afterTextChanged(Editable editable) {
            String sg = height.getText().toString();
            String tz = weight.getText().toString();
            if(!StringUtils.isEmpty(sg) && !StringUtils.isEmpty(tz)){
                BigDecimal bmiVal = new BigDecimal("0");
                bmiVal = new BigDecimal(tz).divide (new BigDecimal(sg).multiply(new BigDecimal(sg)), 2, BigDecimal.ROUND_HALF_UP);
                bmi.setText(bmiVal+"");
                int t = 2;
                if(bmiVal.doubleValue()<18.5){
                    t = 1;
                }else if(bmiVal.doubleValue()>=18.5 && bmiVal.doubleValue()<24){
                    t = 2;
                }else if(bmiVal.doubleValue()>=24 && bmiVal.doubleValue()<28){
                    t = 3;
                }else if(bmiVal.doubleValue()>=28){
                    t = 4;
                }
                switch (t) {
                    case 1:
                        tz_pgjg.check(R.id.tz_pgjg_gq);
                        break;
                    case 2:
                        tz_pgjg.check(R.id.tz_pgjg_zc);
                        break;
                    case 3:
                        tz_pgjg.check(R.id.tz_pgjg_cz);
                        break;
                    case 4:
                        tz_pgjg.check(R.id.tz_pgjg_fp);
                        break;
                }
            }
        }
    }

    public class YaoWeiChangeListener implements TextWatcher {
        /**
         * 编辑框的内容发生改变之前的回调方法
         */
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }
        /**
         * 编辑框的内容正在发生改变时的回调方法 >>用户正在输入
         * 我们可以在这里实时地 通过搜索匹配用户的输入
         */
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {

        }
        /**
         * 编辑框的内容改变以后,用户没有继续输入时 的回调方法
         */
        @Override
        public void afterTextChanged(Editable editable) {
            String yw = yaowei.getText().toString();
            if(!StringUtils.isEmpty(yw)){
                Double ywVal = Double.parseDouble(yw);
                int t = 2;
                if("1".equals(jmxb) && ywVal>=90){
                    t = 1;
                }
                if("2".equals(jmxb) && ywVal>=85){
                    t = 1;
                }
                switch (t) {
                    case 1:
                        yw_pgjg.check(R.id.yw_pgjg_gd);
                        break;
                    case 2:
                        yw_pgjg.check(R.id.yw_pgjg_zc);
                        break;
                }
            }
        }
    }

    public class XueYaChangeListener implements TextWatcher {
        /**
         * 编辑框的内容发生改变之前的回调方法
         */
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }
        /**
         * 编辑框的内容正在发生改变时的回调方法 >>用户正在输入
         * 我们可以在这里实时地 通过搜索匹配用户的输入
         */
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {

        }
        /**
         * 编辑框的内容改变以后,用户没有继续输入时 的回调方法
         */
        @Override
        public void afterTextChanged(Editable editable) {
            String gyStr = xy1.getText().toString();
            String dyStr = xy2.getText().toString();
            if(!StringUtils.isEmpty(gyStr) && !StringUtils.isEmpty(dyStr)){
                int t = 1;
                Double gy = Double.parseDouble(gyStr);
                Double dy = Double.parseDouble(dyStr);
                if(gy<140 && gy>90 && dy<90 && dy>60){
                    t = 1;
                }else if(gy>=140 || dy>=90){
                    t = 3;
                }else if(gy<=90 && dy<=60){
                    t = 2;
                }
                switch (t) {
                    case 1:
                        xy_pgjg.check(R.id.xy_pgjg_zc);
                        break;
                    case 2:
                        xy_pgjg.check(R.id.xy_pgjg_dxy);
                        break;
                    case 3:
                        xy_pgjg.check(R.id.xy_pgjg_gxy);
                        break;
                }
            }
        }
    }

    public class YsxgPgjgChangeListener implements TextWatcher {
        /**
         * 编辑框的内容发生改变之前的回调方法
         */
        @Override
        public void beforeTextChanged(CharSequence s, int start, int count, int after) {

        }
        /**
         * 编辑框的内容正在发生改变时的回调方法 >>用户正在输入
         * 我们可以在这里实时地 通过搜索匹配用户的输入
         */
        @Override
        public void onTextChanged(CharSequence s, int start, int before, int count) {

        }
        /**
         * 编辑框的内容改变以后,用户没有继续输入时 的回调方法
         */
        @Override
        public void afterTextChanged(Editable editable) {
            String shiyanStr = shiyan_rsrl.getText().toString();
            String tangStr = tang_rsrl.getText().toString();
            String youStr = you_rsrl.getText().toString();
            //1-正常，2-高盐，3-高糖,4-食用油摄入量偏高
            ysxg_pgjg.cancelAllSelectedItems();
            if(StringUtils.isEmpty(shiyanStr) && StringUtils.isEmpty(tangStr) && StringUtils.isEmpty(youStr)){
                ysxg_pgjg.setIndexItemSelected(0);
            }else {
                Double shiyan = Double.parseDouble(null ==shiyanStr || "".equals(shiyanStr) ? "0" : shiyanStr);
                Double tang = Double.parseDouble(null ==tangStr || "".equals(tangStr) ? "0" : tangStr);
                Double you = Double.parseDouble(null ==youStr || "".equals(youStr) ? "0" : youStr);
                if(shiyan<=6 && tang<=50 && you<=25 ){
                    ysxg_pgjg.setIndexItemSelected(0);
                }else{
                    if(shiyan>6 ){
                        ysxg_pgjg.setIndexItemSelected(1);
                    }
                    if(tang>50 ){
                        ysxg_pgjg.setIndexItemSelected(2);
                    }
                    if(you>25 ){
                        ysxg_pgjg.setIndexItemSelected(3);
                    }
                }
            }
        }
    }
}
